#include "stdafx.h"
Application * appli = NULL;



#ifdef __APPLE__
int main()
#elif _CONSOLE
int main(int argc, char * argv[])
#else
int WinMain(HINSTANCE a, HINSTANCE b, LPSTR c, int d)
#endif
{
    freopen("output.txt", "w", stdout);

#ifdef _DEBUG
	try 
	{
		appli = new Application;
		appli -> init();
		appli ->  go();
	}
	catch(Ogre::Exception& e)
	{
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        cout << e.getFullDescription() << "\n";
        
        //MessageBox(NULL, e.getFullDescription().c_str(), L"An exception has occured!", MB_OK | MB_ICONERROR| MB_TASKMODAL);
#else
		std::cerr << "An exception has occured: " << e.getFullDescription().c_str() << std::endl;
#endif
	}
#else
	appli = new Application;
	appli -> init();
	appli ->  go();
	return 0;
#endif
    freopen("CON", "w", stdout);

}
